<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加案例 - 766 SMART HOME</title>
<meta name="author" content="BIZ Team" />
<meta name="copyright" content="BIZ" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.tools.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resources/admin/editor/kindeditor.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<style type="text/css">
	.specificationSelect {
		height: 100px;
		padding: 5px;
		overflow-y: scroll;
		border: 1px solid #cccccc;
	}
	
	.specificationSelect li {
		float: left;
		min-width: 150px;
		_width: 200px;
	}
	#feedBack{
		height:300px;
		width:30%;
	}
</style>
<script type="text/javascript">
$().ready(function() {
	var sex = "${cases.sex}";
	var isRelease ="${cases.isRelease}";
	var isCompleted ="${cases.isCompleted}";
	if(sex=="true"){
		$("#sex1").attr("checked", "checked");
	}else{
		$("#sex2").attr("checked", "checked");
	}
	if(isCompleted=="true"){
		$("#isCompleted1").attr("checked", "checked");
	}else{
		$("#isCompleted2").attr("checked", "checked");
	}
	if(isRelease=="true"){
		$("#isRelease1").attr("checked", "checked");
	}else{
		$("#isRelease2").attr("checked", "checked");
	}
	$("[name=productCategory] option[value=${cases.productCategory}]").attr("selected", "selected");
	$("[name=houseType] option[value=${cases.houseType}]").attr("selected", "selected");

	[@flash_message /]
	var $inputForm = $("#inputForm");
	// 表单验证
	$inputForm.validate({
		rules: {
			name:{
				required: true,
				maxlength:5
			},
			sex:{
				required: true
			},
			city:{
				required: true,
				maxlength:50
			},
			residentialQuarters:{
				required: true,
				maxlength:50
			},
			isRelease:{
				required: true
			},
			isCompleted:{
				required: true
			},
			houseType:{
				required: true
			},
			productCategory:{
				required: true
			},
			theme:{
				required: true,
				maxlength:20
			},
			userInfo:{
				required: true
			},
			feedBack:{
				required: true,
				maxlength:200
			},
			schemeConfiguration:{
				required: true
			},
			designNotes:{
				required: true
			},
			sceneDisplay:{
				required: true
			}
		},
		messages: {
			name: {
				required: "必填",
				maxlength: "输入长度最多是 5 的字符串"
			},
			sex:{
				required: "必填"
			},
			city: {
				required: "必填",
				maxlength: "输入长度最多是 50 的字符串"
			},
			residentialQuarters: {
				required: "必填",
				maxlength: "输入长度最多是 50 的字符串"
			},
			isRelease:{
				required: "必填"
			},
			isCompleted:{
				required: "必填"
			},
			houseType:{
				required: "必填"
			},
			productCategory:{
				required: "必填"
			},
			theme:{
				required: "必填",
				maxlength: "输入长度最多是20 的字符串"
			},
			userInfo:{
				required: "必填"
			},
			feedBack:{
				required: "必填",
				maxlength: "输入长度最多是200 的字符串"
			},
			schemeConfiguration:{
				required: "必填"
			},
			designNotes:{
				required: "必填"
			},
			sceneDisplay:{
				required: "必填"
			}
		}
	});
});
if(typeof(KindEditor) != "undefined") {
	KindEditor.ready(function(K) {
		editor = K.create("#editor1", {
			height: "350px",
			items: [
				"source", "|", "undo", "redo", "|", "preview", "print", "template", "cut", "copy", "paste",
				"plainpaste", "wordpaste", "|", "justifyleft", "justifycenter", "justifyright",
				"justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript",
				"superscript", "clearhtml", "quickformat", "selectall", "|", "fullscreen", "/",
				"formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", "bold",
				"italic", "underline", "strikethrough", "lineheight", "removeformat", "|", "image",
				"flash", "media", "insertfile", "table", "hr", "emoticons", "baidumap", "pagebreak",
				"anchor", "link", "unlink"
			],
			langType: shopxx.locale,
			syncType: "form",
			filterMode: false,
			pagebreakHtml: '<hr class="pageBreak" \/>',
			allowFileManager: true,
			filePostName: "file",
			fileManagerJson: shopxx.base + "/admin/file/browser.jhtml",
			uploadJson: shopxx.base + "/admin/file/upload.jhtml",
			uploadImageExtension: setting.uploadImageExtension,
			uploadFlashExtension: setting.uploadFlashExtension,
			uploadMediaExtension: setting.uploadMediaExtension,
			uploadFileExtension: setting.uploadFileExtension,
			extraFileUploadParams: {
				token: getCookie("token")
			},
			afterChange: function() {
				this.sync();
			}
		});
	});
}
if(typeof(KindEditor) != "undefined") {
	KindEditor.ready(function(K) {
		editor = K.create("#editor2", {
			height: "350px",
			items: [
				"source", "|", "undo", "redo", "|", "preview", "print", "template", "cut", "copy", "paste",
				"plainpaste", "wordpaste", "|", "justifyleft", "justifycenter", "justifyright",
				"justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript",
				"superscript", "clearhtml", "quickformat", "selectall", "|", "fullscreen", "/",
				"formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", "bold",
				"italic", "underline", "strikethrough", "lineheight", "removeformat", "|", "image",
				"flash", "media", "insertfile", "table", "hr", "emoticons", "baidumap", "pagebreak",
				"anchor", "link", "unlink"
			],
			langType: shopxx.locale,
			syncType: "form",
			filterMode: false,
			pagebreakHtml: '<hr class="pageBreak" \/>',
			allowFileManager: true,
			filePostName: "file",
			fileManagerJson: shopxx.base + "/admin/file/browser.jhtml",
			uploadJson: shopxx.base + "/admin/file/upload.jhtml",
			uploadImageExtension: setting.uploadImageExtension,
			uploadFlashExtension: setting.uploadFlashExtension,
			uploadMediaExtension: setting.uploadMediaExtension,
			uploadFileExtension: setting.uploadFileExtension,
			extraFileUploadParams: {
				token: getCookie("token")
			},
			afterChange: function() {
				this.sync();
			}
		});
	});
}
if(typeof(KindEditor) != "undefined") {
	KindEditor.ready(function(K) {
		editor = K.create("#editor3", {
			height: "350px",
			items: [
				"source", "|", "undo", "redo", "|", "preview", "print", "template", "cut", "copy", "paste",
				"plainpaste", "wordpaste", "|", "justifyleft", "justifycenter", "justifyright",
				"justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript",
				"superscript", "clearhtml", "quickformat", "selectall", "|", "fullscreen", "/",
				"formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", "bold",
				"italic", "underline", "strikethrough", "lineheight", "removeformat", "|", "image",
				"flash", "media", "insertfile", "table", "hr", "emoticons", "baidumap", "pagebreak",
				"anchor", "link", "unlink"
			],
			langType: shopxx.locale,
			syncType: "form",
			filterMode: false,
			pagebreakHtml: '<hr class="pageBreak" \/>',
			allowFileManager: true,
			filePostName: "file",
			fileManagerJson: shopxx.base + "/admin/file/browser.jhtml",
			uploadJson: shopxx.base + "/admin/file/upload.jhtml",
			uploadImageExtension: setting.uploadImageExtension,
			uploadFlashExtension: setting.uploadFlashExtension,
			uploadMediaExtension: setting.uploadMediaExtension,
			uploadFileExtension: setting.uploadFileExtension,
			extraFileUploadParams: {
				token: getCookie("token")
			},
			afterChange: function() {
				this.sync();
			}
		});
	});
}
if(typeof(KindEditor) != "undefined") {
	KindEditor.ready(function(K) {
		editor = K.create("#editor4", {
			height: "350px",
			items: [
				"source", "|", "undo", "redo", "|", "preview", "print", "template", "cut", "copy", "paste",
				"plainpaste", "wordpaste", "|", "justifyleft", "justifycenter", "justifyright",
				"justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript",
				"superscript", "clearhtml", "quickformat", "selectall", "|", "fullscreen", "/",
				"formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", "bold",
				"italic", "underline", "strikethrough", "lineheight", "removeformat", "|", "image",
				"flash", "media", "insertfile", "table", "hr", "emoticons", "baidumap", "pagebreak",
				"anchor", "link", "unlink"
			],
			langType: shopxx.locale,
			syncType: "form",
			filterMode: false,
			pagebreakHtml: '<hr class="pageBreak" \/>',
			allowFileManager: true,
			filePostName: "file",
			fileManagerJson: shopxx.base + "/admin/file/browser.jhtml",
			uploadJson: shopxx.base + "/admin/file/upload.jhtml",
			uploadImageExtension: setting.uploadImageExtension,
			uploadFlashExtension: setting.uploadFlashExtension,
			uploadMediaExtension: setting.uploadMediaExtension,
			uploadFileExtension: setting.uploadFileExtension,
			extraFileUploadParams: {
				token: getCookie("token")
			},
			afterChange: function() {
				this.sync();
			}
		});
	});
}
</script>
</head>
<body>
	<div class="path">
		<a href="${base}/admin/common/index.jhtml">${message("admin.path.index")}</a> &raquo;添加案例
	</div>
	<form id="inputForm" action="update.jhtml" method="post" enctype="multipart/form-data">
		<ul id="tab" class="tab">
			<li>
				<input type="button" value="基本信息" />
			</li>
			<li>
				<input type="button" value="用户情况" />
			</li>
			<li>
				<input type="button" value="方案配置" />
			</li>
			<li>
				<input type="button" value="设计说明" />
			</li>
			<li>
				<input type="button" value="现场展示" />
			</li>
		</ul>
		<table class="input tabContent">
			<tr>
				<th>
					<span class="requiredField">*</span>用户:
				</th>
				<td>
					<input type="text" name="name" class="text" maxlength="200" value="${cases.name}"/>
					<input type="hidden" name="id" class="text" maxlength="200" value="${cases.id}"/>
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>性别:
				</th>
				<td>
					<input type="radio" name="sex" id="sex1" maxlength="200" value="1"/>男
					<input type="radio" name="sex" id="sex2" maxlength="200" value="0"/>女
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>城市:
				</th>
				<td>
					<input type="text" name="city" class="text" maxlength="100" title="${message("admin.product.snTitle")}" value="${cases.city}" />
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>小区名称:
				</th>
				<td>
					<input type="text" name="residentialQuarters" class="text" maxlength="16" value="${cases.residentialQuarters}"/>
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>是否发布:
				</th>
				<td>
					<input type="radio" name="isRelease" id="isRelease1" maxlength="200" value="1"/>是
					<input type="radio" name="isRelease" id="isRelease2" maxlength="200" value="0"/>否
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>是否竣工:
				</th>
				<td>
					<input type="radio" name="isCompleted" id="isCompleted1" maxlength="200" value="1"/>是
					<input type="radio" name="isCompleted" id="isCompleted2" maxlength="200" value="0"/>否
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>户型:
				</th>
				<td>
				 <select class="option" name="houseType">
					<option value="">请选择</option>
				 	[#list dictionaryList as dic]
				 		<option value="${dic.id}">${dic.title}</option>
					[/#list]
				</select>
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>系统:
				</th>
				<td>
					 <select class="option" name="productCategory">
					 	<option value="">请选择</option>
					 	[#list listPc as lipc]
						<option value="${lipc.id}">${lipc.name}</option>
						[/#list]
					 </select>
				</td>
			 </tr>
			<tr>
				<th>
					<span class="requiredField">*</span>主题:
				</th>
				<td>
					<input type="text" name="theme" class="text" maxlength="200" value="${cases.theme}"/>
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span>用户反馈:
				</th>
				<td>
					<textarea name="feedBack" id="feedBack">
${cases.feedBack}</textarea>
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField"></span>上传案例主图：
				</th>
				<td>
					<input type="file" name="uploadFile" value="请选择文件">
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th>
					<span class="requiredField">*</span>用户情况:
				</th>
				<td>
					<textarea id="editor4" name="userInfo" class="editor" style="width: 100%;">
${cases.userInfo}</textarea>
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th>
					<span class="requiredField">*</span>方案配置:
				</th>
				<td>
					<textarea id="editor1" name="schemeConfiguration" class="editor" style="width: 100%;">
${cases.schemeConfiguration}</textarea>
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th>
					<span class="requiredField">*</span>设计说明:
				</th>
				<td>
					<textarea id="editor2" name="designNotes" class="editor" style="width: 100%;">
${cases.designNotes}</textarea>
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th>
					<span class="requiredField">*</span>现场展示:
				</th>
				<td>
					<textarea id="editor3" name="sceneDisplay" class="editor" style="width: 100%;">
${cases.sceneDisplay}</textarea>
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="${message("admin.common.submit")}" />
					<input type="button" class="button" value="${message("admin.common.back")}" onclick="location.href='list.jhtml'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>